﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ECRMS.WinForm.BaseClass;
using System.Linq;
using DevExpress.XtraTreeList;
using ECRMS.WinForm.Properties;
using System.ServiceModel;


namespace ECRMS.WinForm.Modules
{
   // [ModuleInstance((int)ModuleEnum.公司新闻)]
    public partial class testModule : BaseModule
    {
        public testModule()
        {
            base.core.CreateWaitDialog("初始化中请稍候...","");
            InitializeComponent();
            InitView();
            InitEventHandler();
            base.core.CloseWaitDialog();
        }

        private void InitView()
        {
            ChangeLanguage(base.core.CoreLanguage);
        }

        private void InitEventHandler()
        {
            //语言切换
            base.core.LangChanged += new Core.LanguageChangedHandler(this.ChangeLanguage);
        }

        private void ChangeLanguage(LangEnum lang)
        {
            //switch (core.NowLanguage)
            switch (lang)
            {
                case LangEnum.China:
                case LangEnum.中文:
                    labelControl1.Text = Language_ch.test;
                    break;
                case LangEnum.English:
                case LangEnum.英文:
                    labelControl1.Text = Language_en.test;
                    break;
                default:
                    break;
            }
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            //labelControl1.Text = core.CoreService.GetData(123);
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            //labelControl1.Text = core.CoreService.GetData(321);
        }
    }
}
